function locmap(e, a) {
    var t = {
        zoom: 16,
        center: new google.maps.LatLng(e, a),
        styles: [{
            featureType: "water",
            stylers: [{
                color: "#d2d8e1"
            }, {
                visibility: "on"
            }]
        }, {
            featureType: "landscape",
            stylers: [{
                color: "#ecebea"
            }]
        }, {
            featureType: "road",
            stylers: [{
                saturation: -100
            }, {
                lightness: 45
            }]
        }, {
            featureType: "road.highway",
            stylers: [{
                visibility: "simplified"
            }]
        }, {
            featureType: "road.arterial",
            stylers: [{
                visibility: "off"
            }],
            elementType: "labels.icon"
        }, {
            featureType: "administrative",
            stylers: [{
                color: "#e0d9d0"
            }],
            elementType: "labels.text.fill"
        }, {
            featureType: "transit",
            stylers: [{
                visibility: "off"
            }]
        }, {
            featureType: "poi",
            stylers: [{
                visibility: "off"
            }]
        }]
    };
    map = new google.maps.Map(document.getElementById("map"), t); {
        var o = new google.maps.LatLng(e, a);
        new google.maps.Marker({
            position: o,
            map: map,
            icon: image
        })
    }
}

function codeAddress(e) {
    var a = new google.maps.Geocoder;
    a.geocode({
        address: e
    }, function (e, a) {
        if (a == google.maps.GeocoderStatus.OK) {
            map.setCenter(e[0].geometry.location); {
                new google.maps.Marker({
                    map: map,
                    position: e[0].geometry.location,
                    icon: image
                })
            }
        }
    })
}

function checkNews() {
    var e = window.location.hash;
    window.location.hash.match(/^#news/) && ($.fn.fullpage.moveTo("news"), window.location.hash = e, $(".load-news").each(function () {
        $(this).data("value") == e.replace("#news/", "") && $(this).trigger("click")
    }))
}

function loadNews(e) {
    $.ajax({
        type: "get",
        dataType: "html",
        url: "/loadnews/" + e,
        success: function (a) {
            $("#news-content").html(a), window.location.hash = "#news/" + e;
            var t = $("#news-prev-next").data("newsprev"),
                o = $("#news-prev-next").data("newsnext"),
                n = $(".overlay a.prev"),
                s = $(".overlay a.next");
            n.show(), s.show(), "" != t ? (n.unbind("click"), n.bind("click", function () {
                loadNews(t)
            })) : n.hide(), "" != o ? (s.unbind("click"), s.bind("click", function () {
                loadNews(o)
            })) : s.hide()
        }
    })
}
var map, image = "/plugins/images/map.png";
$(function () {
    $(".load-location").click(function (e) {
        return $.ajax({
            type: "get",
            dataType: "json",
            url: "/loadstore/" + $(this).data("value"),
            success: function (e) {
                if (e.success) {
                    var a = "";
                    "" != e.open_hours && (a += e.open_hours + "<br>"), "" != e.telephone && (a += e.telephone + "<br>"), "" != e.address && (a += e.address + "<br>"), "" != e.notes && (a += e.notes + "<br>"), codeAddress(e.address), $(".location-title").html(e.title), $(".location-info p").eq(0).html(a), $(".map-look").attr("href", "https://www.google.com.tw/maps/place/" + e.address + "/"), "" != e.menu_link && ($(".menu-img").attr("href", e.menu_link), $(".menu-img img").eq(0).attr("src", e.menu_image))
                }
            }
        }), e.preventDefault(), !1
    }), $(".load-news").click(function (e) {
        var a = $(this).data("value");
        return loadNews(a), e.preventDefault(), !1
    })
});